#ifndef _SOURCE_MAXNODESELECTOR_H_
#define _SOURCE_MAXNODESELECTOR_H_

#include "UIOptions.h"
//-----------------------------------------------------------------------------------
/// class CMaxNodeSelector : get node from max and strip data from any nodes.
//-----------------------------------------------------------------------------------

enum EMaxVersion;

struct ListInfo
{
	int idx;
	int start;
	int end;
	ListInfo(void);
};

struct ExtraNodeInfo
{
	ListInfo listInfo[ExportEle_Count][g_maxChannel];
};

struct MaxInitInfo
{
	EMaxVersion version;
};

union CommonData
{
	float f4[4];
	int   i4[4];
};

class CNodeInfo
{
public:
	// if first parameter type is "type", then return ExportObject. return zero to indicate process success or not.
	// about valid string for 'type', see doc in max_exporter
	virtual const unsigned int GetData(const char* type, const int idx, CommonData* data) const = 0;
};

struct NodeList
{
	CNodeInfo* info;
	CNodeInfo* next;
	ExtraNodeInfo extraInfo;
};

struct UIOptions;

class CMaxNodeSelector
{
public:
	CMaxNodeSelector(void);
	~CMaxNodeSelector(void);

	virtual bool Init(MaxInitInfo* initInfo) = 0;
	virtual bool FindNodes(UIOptions* options) = 0;
	// must invoked after call FindNodes().
	const int GetNodeCount(const ExportObject type) const;
	const NodeList* GetNodeInfo(const ExportObject type, const int index)const;
	void Clear(void);

protected:
	NodeList* m_pList[ExportObject_Count];
};

#endif // #ifndef _SOURCE_MAXNODESELECTOR_H_